<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>pooledit</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="<%=request.getContextPath()%>/static/layui/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form" name = "body" action="Hello">

    <div class="layui-form-item">
    <label class="layui-form-label">水池编号</label>
    <div class="layui-input-inline">
    <input type="text" readOnly="true" name="poolPK" id="poolPk" required  lay-verify="required|number" placeholder="请输入ID" autocomplete="off" class="layui-input" />
    </div>
    </div>

    <div class="layui-form-item">
    <label class="layui-form-label">水池名</label>
    <div class="layui-input-inline">
    <input type="text"  name="name" id="name"  required lay-verify="required" placeholder="请输入角色名" autocomplete="off" class="layui-input" />
    </div>
    </div>

    <div class="layui-form-item">
    <label class="layui-form-label">所属镇(乡)</label>
    <div class="layui-input-inline">
    <input type="text"  name="fkToPk" id="fkToPk"  required lay-verify="required" placeholder="请输入父节点" autocomplete="off" class="layui-input" />
    </div>
    </div>

    <div class="layui-form-item">
    <label class="layui-form-label">经度</label>
    <div class="layui-input-inline">
    <input type="text"  name="lati" id="lati"  required lay-verify="required" placeholder="请输入角色名" autocomplete="off" class="layui-input" />
    </div>
    </div>


    <div class="layui-form-item">
    <label class="layui-form-label">纬度</label>
    <div class="layui-input-inline">
    <input type="text"  name="loit" id="loit"  required lay-verify="required" placeholder="请输入角色名" autocomplete="off" class="layui-input" />
    </div>
    </div>

    <div class="layui-form-item">
    <div class="layui-input-block">
    <button class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
    </div>
</form>

<script src="<%=request.getContextPath()%>/static/layui/layui.js" charset="utf-8"> </script>
 
<script>
//Demo
layui.use(['form','jquery'], function()
{
  var form = layui.form;
  var $ =  layui.$;
  form.on('submit()', function(data){
 	var paramenter = $("form").serialize();
  	$.ajax({
  		type: 'post'
  		,data: paramenter
  		,url:'poolUpdate'
  		,success: function(data) {
  			if (data) {
  				layer.alert("提交成功");
                layer.close(layer.index);
                window.parent.location.reload();
  			}
  			else{
  		 		layer.alert("提交失败")
  		 	}
  		}
  	});
	  
      return false;
  });
});
</script>
</body>
</html>